package org.batatasframework.strategy;

import javax.servlet.http.HttpServletResponse;

import org.batatasframework.common.ParameterReader;
import org.batatasframework.manager.HtmlDetailBuilder;
import org.batatasframework.manager.RuntimeManager;
import org.batatasframework.notice.NoticeContent;
import org.batatasframework.notice.RuntimeNotifier;


/**
 * 本地服务器的策略，这个应该是在系统运行的时候，可以通过管理员进行设置的；
 * 比如，设置一个时后服务器暂停服务等
 * @author jackson
 *
 */
public class ServerStrategyLocalhost extends AbstractServiceStrategyHandler implements RuntimeManager, RuntimeNotifier/*, ServletContextAware*/{

	/*private ServletContext servletContext;*/
	
	public ServerStrategyLocalhost() {
		super("LOCALHOST", "本服务器");
	}

	@Override
	public ServerStrategyResult execute(HttpServletResponse response, ServerStrategyEvent event) {
		// TODO Auto-generated method stub
		return ServerStrategyResult.CONTINUE;
	}

	@Override
	public NoticeContent notice() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void reset() throws Exception {
		// TODO Auto-generated method stub
		
	}
	
	private final HtmlDetailBuilder htmlBuilder = new HtmlDetailBuilder(){

		@Override
		public String getId() {
			return id;
		}

		@Override
		public String getName() {
			return name;
		}

		@Override
		public String getHtml() {
			// TODO Auto-generated method stub
			return "";
		}

		@Override
		public boolean isEditable() {
			return false;
		}
		
	};
	
	@Override
	public HtmlDetailBuilder getHtmlBuilder() {
		return htmlBuilder;
	}
	
	@Override
	public void save(ParameterReader paraReader) throws Exception {
		// TODO Auto-generated method stub
		
	}
}
